Xbasic

ftp_upload_curl Function

Syntax

dim result as c = ftp_upload_curl(FileList as C, SourceFolder as C, Address as C, TargetFolder as C, UserName as C, Password as C [], Options as P [, flagNoUI as L]])

Arguments

FileListCharacter

List of files to upload.

SourceFolderCharacter

Where the files are located.

AddressCharacter

The URL where files are being uploaded.

TargetFolderCharacter

The folder at the target location where files will be uploaded.

UserNameCharacter

Your FTP username.

PasswordCharacter

Your FTP password.

OptionsPointer

Default = null_value().

flagNoUILogical

Default = .f.. In web applications, this property is ignored.

Returns

resultCharacter

Returns one of the following values:

Value
Description
OK

Files uploaded successfully.

Cancel

Upload was cancelled.

ERROR

Upload failed. If run in a desktop application with UI enabled, a message box is shown with details about the failure. Otherwise, no further information is given.

Description

Uploads files to a server using CURL to execute the FTP command.

Discussion

This function performs an FTP file upload using the CURL object. This function takes an optional parameter, flagNoUI, which must be set to .t. in web applications. Any functions that display UI cannot be used in web applications.

Example

ServerName="ftp.myftpserver.com"
remotedir="/name_of_target_folder"
Username="username"
Password="alpha"
fn = "C:\MovieImages\4546.JPG"
result=FTP_Upload_Curl(fn,"",servername,remotedir,Username,Password,null_value())